{{/* Copyright 2017 The LUCI Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */}}

{{define "title"}}Masters{{end}}

{{define "content"}}
  {{with .Model}}
<ol class="breadcrumb">
  <li class="active"><a href="/">All masters</a></li>
</ol>

<div class="container">
  <div class="row">
    <div class="col-sm-12">

      <h2>Masters</h2>
      <table class="table">
        <thead>
          <tr>
            <td>Name</td>
            <td>Total builders</td>
            <td title="Not Prod on LUCI and found on Buildbot">Not Flipped</td>
            <td title="Prod on LUCI and found on Buildbot">Need Decom</td>
            <td title="Prod on LUCI and not found on Buildbot">Decommed</td>
            <td title="Not Prod on LUCI and not found on Buildbot">Not Found on Buildbot</td>
            <td>WAI builders</td>
            <td>Migrated builders</td>
          </tr>
        </thead>
        <tbody>
    {{range $m := .Masters}}
          <tr>
            <td>
              <a href="masters/{{$m.Name}}/">{{$m.Name}}</a>
            </td>
            <td>{{$m.TotalBuilderCount}}</td>
            <td class="bg-danger">{{index $m.LUCIBuildbotCounts 0 1}}</td>
            <td class="bg-success">{{index $m.LUCIBuildbotCounts 1 1}}</td>
            <td class="bg-info">{{index $m.LUCIBuildbotCounts 1 0}}</td>
            <td class="bg-warning">{{index $m.LUCIBuildbotCounts 0 0}}</td>
            <td>{{$m.WAIBuilderCount}} ({{$m.WAIBuilderPercent}}%)</td>
            <td>{{$m.MigratedBuilderCount}} ({{$m.MigratedBuilderPercent}}%)</td>
          </tr>
    {{end}}
        </tbody>
      </table>
    </div>
  </div>
</div>
  {{end}}
{{end}}
